<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.cn.zaprk.utils.PageInfo" %>
<%@ page import="com.cn.zaprk.beans.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">s
    <title></title>
</head>
<body>
<table border="1" cellspacing="0" cellpadding="10">
    <tr>
        <th>ID</th>
        <th>用户名字</th>
        <th>密码</th>
        <th>邮箱</th>
        <th>电话号码</th>
        <th>工资</th>
    </tr>

    <c:forEach items="${pageInfo.getInfo()}" var="user">
        <tr>
            <td>${user.getId()}</td>
            <td>${user.getUsername()}</td>
            <td>${user.getPassword()}</td>
            <td>${user.getEmail()}</td>
            <td>${user.getPhone()}</td>
            <td>${user.getSalary()}</td>
        </tr>
    </c:forEach>

    <tr>
        <td></td>
        <td>总数据量：${pageInfo.getSum()}</td>
        <td>
            <a href='${pageContext.servletContext.contextPath}/page_up_next.do?sumNumber=${pageInfo.getSum()}&currentP=${pageInfo.getUpPage()}&pageNum=${pageInfo.getPageNumber()}&number=${pageInfo.getNumber()}'>上一页</a>
        </td>
        <td>第${pageInfo.getCurrentPage() + 1}页</td>
        <td>
            <a href='${pageContext.servletContext.contextPath}/page_up_next.do?sumNumber=${pageInfo.getSum()}&currentP=${pageInfo.getNextPage()}&pageNum=${pageInfo.getPageNumber()}&number=${pageInfo.getNumber()}'>下一页</a>
        </td>
        <td>${pageInfo.getPageNumber()}页</td>
    </tr>
    
    <%--<%
        // 获取请求绑定数据
        PageInfo<User> pageInfo = (PageInfo<User>) request.getAttribute("pageInfo");
        // 循环遍历
        for (User user : pageInfo.getInfo()) {
            out.println("<tr>");
            out.println("<td>" + user.getId() + "</td>");
            out.println("<td>" + user.getUsername() + "</td>");
            out.println("<td>" + user.getPassword() + "</td>");
            out.println("<td>" + user.getEmail() + "</td>");
            out.println("<td>" + user.getPhone() + "</td>");
            out.println("<td>" + user.getSalary() + "</td>");
            out.println("</tr>");
        }

        out.println("<tr><td></td>");

        out.println("<td>总数据量："+pageInfo.getSum()+"</td>");

        out.println("<td><a href='"+request.getServletContext().getContextPath()+
                "/page_up_next.do?sumNumber="+pageInfo.getSum()+"&currentP="+pageInfo.getUpPage()+
                "&pageNum="+pageInfo.getPageNumber()+"&number="+pageInfo.getNumber()+"'>上一页</a></td>");

        out.println("<td>第"+(pageInfo.getCurrentPage() + 1)+"页</td>");

        out.println("<td><a href='"+request.getServletContext().getContextPath()+
                "/page_up_next.do?sumNumber="+pageInfo.getSum()+"&currentP="+pageInfo.getNextPage()+
                "&pageNum="+pageInfo.getPageNumber()+"&number="+pageInfo.getNumber()+"'>下一页</a></td>");

        out.println("<td>"+pageInfo.getPageNumber()+"页</td>");

    %>--%>



</table>
</body>
</html>
